package com.huynhchihieu.dao;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Repository;

import com.huynhchihieu.domain.ABC;
import com.huynhchihieu.domain.Job;

@Repository
public class JobDaoImpl implements JobDAO {
	Logger log = Logger.getLogger(JobDaoImpl.class);

	@PersistenceContext(name = "persistenceUnit")
	EntityManager entityManager;

	public void addJob(Job job) {
		log.debug("persisting Job instance");
		try {
			entityManager.persist(job);
			log.debug("register Job beans successful");
		} catch (RuntimeException re) {
			log.error("persist failed", re);
            throw re;
		}
	}

}
